  import {mapGetters} from "vuex"
export default {
  computed:{
    ...mapGetters("m_cart",["total"]),
    },
    watch:{
      
      total(){
     
            this.setBar()
      }
    },
    onShow() { 
          if(this.total===0) return false
      this.setBar()
    },
    
    methods:{
      setBar(){
  
        uni.setTabBarBadge({
          index:2,
          text:this.total+""
        })
      }
    }
  }

